
g_Itemw = 100
g_Itemh = 30
g_Itempx = 4
g_Itempy = 4

EditWin = {
	type="window",
	name="EditWin",
	__Container={
	--{type="checkbox",name="",id="",width=100,height=50,paddingx=4,paddingy=4},
	--[[
	{type="checkbox",	name="Select",	id="Select",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,group="mousetype"},
	{type="break"},
	{type="checkbox",	name="Move",	id="Move",		width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,group="mousetype"},
	{type="checkbox",	name="Rotate",	id="Rotate",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,group="mousetype"},
	{type="checkbox",	name="Scale",	id="Scale",		width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,group="mousetype"},
--]]
	{type="pushbutton",	name="EditVertex",	id="EditVertex",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="EditFace",	id="EditFace",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},

	{type="break"}

	}
}
UILayout.CalSize(3,EditWin)

TexWin = {
	type="window",
	name="TexWin",
__Container={
		{type="combobox",	id="ComboTex",width=300,height=44,comboheight=150,paddingx=4,paddingy=4},
		{type="break"},
		{type="pushbutton", name="Apply", id="Apply", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
		{type="pushbutton", name="View", id="View", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
		{type="break"},
		{type="pushbutton", name="Save", id="Save", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
		{type="pushbutton", name="Load", id="Load", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(3,TexWin)

ShaderWin = {
	type="window",
	name="ShaderWin",
__Container={
		{type="combobox",	id="ComboShader",width=300,height=44,comboheight=150,paddingx=4,paddingy=4},
		{type="break"},
		{type="pushbutton", name="Apply", id="Apply", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
		{type="pushbutton", name="Load", id="Load", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(3,ShaderWin)

MainWin = {
	type="window",
	name="Main",
__Container={
		{type="pushbutton", name="Load", id="Load", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,onclick=SaveLoadMode.Load},
		{type="pushbutton", name="Save", id="Save", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,onclick=SaveLoadMode.Save}
	}
}
UILayout.CalSize(3,MainWin)
--[[
GeometryWin = {
	type="window",
	name="Geometry",
	__Container={
	{type="checkbox",	name="Plane",	id="Plane",		width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,group="mousetype"},
	{type="checkbox",	name="Cube",	id="Cube",		width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,group="mousetype"},
	{type="checkbox",	name="Sphere",	id="Sphere",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,group="mousetype"},
	{type="checkbox",	name="Cylinder",	id="Cylinder",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy,group="mousetype"}
	}
}
UILayout.CalSize(4,GeometryWin)--]]

ObjState = {
	type="window",
	name="ObjState",
	__Container={
	{type="pushbutton",	name="Wireframe",	id="Wireframe",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.Wireframe},
	{type="pushbutton", name="Vertex", 		id="Vertex", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.Vertex},
	{type="pushbutton", name="CullNone", id="CullNone", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.CullNone},
	{type="pushbutton", name="AlphaBlend", id="AlphaBlend", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.AlphaBlend},
	{type="pushbutton", name="AlphaTest", id="AlphaTest", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.AlphaTest},
	{type="pushbutton", name="Group", id="Group", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.Group},
	{type="pushbutton", name="Remove", id="Remove", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.Remove},
	{type="pushbutton", name="Combine", id="Combine", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.Combine},
	{type="pushbutton", name="ComputeN", id="ComputeN", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.ComputeNormal},
	{type="pushbutton", name="Light", id="Light", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy, onclick=ObjStateMode.Light}
	}
}
UILayout.CalSize(3,ObjState)

CameraState = {
	type="window",
	name="CameraState",
	__Container={
	{type="static", name="Speed", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Speed", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="X2",	id="X2",	width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="Half",id="Half",	width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="Set",	id="Set",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(4,CameraState)

MoveProp = {
	type="window",
	name="MoveProp",
	__Container={
	{type="static", name="X", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="X", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="Y", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Y", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="Z", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Z", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="Move",	id="Move",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,MoveProp)

SphereProp = {
	type="window",
	name="SphereProp",
	__Container={
	{type="static", name="Slice", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Slice", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="Stack", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Stack", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,SphereProp)

PlaneProp = {
	type="window",
	name="PlaneProp",
	__Container={
	{type="static", name="Row", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Row", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="Col", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Col", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,PlaneProp)

CubeProp = {
	type="window",
	name="CubeProp",
	__Container={
	{type="static", name="Create?", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,CubeProp)

CylinderProp = {
	type="window",
	name="CylinderProp",
	__Container={
	{type="static", name="Slice", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Slice", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="Stack", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Stack", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,CylinderProp)

LightConfirm = {
	type="window",
	name="LightConfirm",
	__Container={
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,LightConfirm)

LightProp = {
	type="window",
	name="LightConfirm",
	__Container={
	{type="static", name="Diffuse", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Dr", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Dg", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Db", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Da", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},

	{type="static", name="Ambient", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Ar", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Ag", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Ab", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Aa", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},

	{type="static", name="Specular", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Sr", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Sg", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Sb", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Sa", width=g_Itemw/2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},

	{type="static", name="Range", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Range", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="static", name="Falloff", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Falloff", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="static", name="Att0", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Att0", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="static", name="Att1", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Att1", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="static", name="Att2", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Att2", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="static", name="Theta", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Theta", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="static", name="Phi", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="Phi", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="pushbutton",	name="Set",		id="Set",	width=g_Itemw*1.5,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Quit", 	id="Quit", 	width=g_Itemw*1.5,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(5,LightProp)

CylinderFourProp = {
	type="window",
	name="CylinderFourProp",
	__Container={
	{type="static", name="NumWidth", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="NumWidth", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="NumHeight", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="NumHeight", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,CylinderFourProp)

GrassProp = {
	type = "window",
	name = "GrassProp",
	__Container={
	{type="static",name="GrassAmount",width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itemy},
	{type="editbox",id="GrassAmount",width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itemy},
	{type="static",name="GrassHeight",width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itemy},
	{type="editbox",id="GrassHeight",width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itemy},
	{type="static",name="GrassWidth",width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itemy},
	{type="editbox",id="GrassWidth",width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itemy},
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,GrassProp)

TexcoordProp = {
	type="window",
	name="TexcoordProp",
	__Container={
	{type="static", name="Click Ok To Edit", width=g_Itemw*2,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="pushbutton",	name="Rotate90",id="Rotate90",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="Orient",id="Orient",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,TexcoordProp)

TexcoordConfirm = {
	type="window",
	name="Confirm",
	__Container={
	{type="static", name="CoefX", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="CoefX", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="CoefY", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="CoefY", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="checkbox", name="TileMode", id="TileMode", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="pushbutton", name="SetCoef", id="SetCoef", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},

	{type="static", name="NumX", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="NumX", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="NumY", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="NumY", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="GridX", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="GridX", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="GridY", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="GridY", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="SetGrid", id="SetGrid", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="static", name="PixelX", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="PixelX", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="PixelY", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="PixelY", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="PixelW", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="PixelW", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static", name="PixelH", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id="PixelH", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="SetPGrid", id="SetPGrid", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="pushbutton",	name="Ok",		id="Ok",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Cancel", 	id="Cancel", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,TexcoordConfirm)

FreeTexConfirm = {
	type="window",
	name="FreeTexGen",
	__Container={
	{type="static",	name="Left",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id = "LeftEdit", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static",	name="Top",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id = "TopEdit", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static",	name="Right",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id = "RightEdit", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="static",	name="Bottom",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="editbox", id = "BottomEdit", width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton",	name="SetGrid",		id="SetGrid",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="break"},
	{type="pushbutton",	name="Gen",		id="Gen",	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy},
	{type="pushbutton", name="Quit", 	id="Quit", 	width=g_Itemw,height=g_Itemh,paddingx=g_Itempx,paddingy=g_Itempy}
	}
}
UILayout.CalSize(2,FreeTexConfirm)

ChangeMode_BackMode = nil
function ChangeMode(mode,name)
	TRACE("Mode - Change")
	if g_CurMode then g_CurMode.FuncSeq.End() end
	if g_CurMode==mode then
		TRACE(" to backmode.\n")
		g_CurMode = ChangeMode_BackMode
		return
	end
	TRACE(" to "..name.."\n")
	g_CurMode = mode
end

IamTest1 = {
	type = "listbox",
	focuseffect=false,
	__Container = {
		{type="pushbutton", name="test", id="test11", width=g_Itemw,height=g_Itemh,
			onclick = function ()
			end
		},
		{type="pushbutton", name="Pop", id="test12", width=g_Itemw,height=g_Itemh,pop=IamTest2}

	}
}
LightPop = {
	type = "listbox",
	focuseffect=false,
	__Container = {
		{type="pushbutton", name="PointLight", id="PointLight", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(PointLightMode,"PointLightMode")
			end
		},
		{type="pushbutton", name="DirLight", id="DirLight", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(DirLightMode,"DirLightMode")
			end
		},
		{type="pushbutton", name="SpotLight", id="SpotLight", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(SpotLightMode,"SpotLightMode")
			end
		},
		{type="pushbutton", name="LightProp", id="LightProp", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(LightPropMode,"LightPropMode")
			end
		}
	}
}
GeometryPop = {
	type = "listbox",
	focuseffect=false,
	__Container = {
		{type="pushbutton", name="Plane", id="Plane", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(PlaneMode,"PlaneMode")
			end
		},
		{type="pushbutton", name="Cube", id="Cube", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(CubeMode,"CubeMode")
			end
		},
		{type="pushbutton", name="Sphere", id="Sphere", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(SphereMode,"SphereMode")
			end
		},
		{type="pushbutton", name="Cylinder", id="Cylinder", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(CylinderMode,"CylinderMode")
			end
		},
		{type="pushbutton", name="CylinderFour", id="CylinderFour", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(CylinderFourMode,"CylinderFourMode")
			end
		},
		{type="pushbutton", name="Grass", id="Grass", width=g_Itemw,height=g_Itemh,
			onclick = function ()
				ChangeMode(GrassMode,"GrassMode")
			end
		}
	}
}
EditPop = {
	x=300,y=200,
	type="listbox",
	focuseffect=false,
	__Container={
	{type="pushbutton", name="Select", id="Select", width=g_Itemw,height=g_Itemh,
		onclick = function ()
			ChangeMode(SelectMode,"SelectMode")
		end},
	{type="pushbutton", name="Move", id="Move", width=g_Itemw,height=g_Itemh,
		onclick = function ()
			ChangeMode(MoveMode,"MoveMode")
		end},
	{type="pushbutton", name="Scale", id="Scale", width=g_Itemw,height=g_Itemh,
		onclick = function ()
			ChangeMode(ScaleMode,"ScaleMode")
		end},
	{type="pushbutton", name="Rotate", id="Rotate", width=g_Itemw,height=g_Itemh,
		onclick = function ()
			ChangeMode(RotateMode,"RotateMode")
		end},
	{type="pushbutton", name="Geometry >", id="Geometry", width=g_Itemw,height=g_Itemh, pop=GeometryPop},
	{type="pushbutton", name="Light >", id="Light", width=g_Itemw,height=g_Itemh, pop=LightPop},
	{type="pushbutton", name="GenTexc", id="GenTexc", width=g_Itemw,height=g_Itemh,
		onclick = function ()
			ChangeMode(TexcoordMode,"TexcoordMode")
		end},
	{type="pushbutton", name="GenTexFree", id="GenTexFree", width=g_Itemw,height=g_Itemh,
		onclick = function ()
			ChangeMode(FreeTexMode,"FreeTexMode")
		end},
	{type="pushbutton", name="ExtractTris", id="ExtractTris", width=g_Itemw,height=g_Itemh,
		onclick = function ()
			ChangeMode(ExtractTrisMode,"ExtractTrisMode")
		end}
	}
}

UILayout.CalSize(1,EditPop)
UILayout.CalSize(1,GeometryPop)
UILayout.CalSize(1,IamTest1)
UILayout.CalSize(1,LightPop)
